﻿<%@ Page Language="C#" MasterPageFile="~/teachers/masterpage.Master" AutoEventWireup="true" CodeBehind="TProfile.aspx.cs" Inherits="ESCHOOL.teachers.WebForm2" Title="Teacher Profile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style7
        {
            width: 94%;
            height: 485px;
        }
        .style8
        {
            text-align: left;
            height: 17px;
        }
        .style9
        {
            width: 149px;
        }
        .style10
        {
            text-align: left;
            width: 149px;
        }
        .style11
        {
            text-align: left;
            height: 17px;
            width: 149px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">

                    <p>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    </p>
                    <asp:Panel ID="Panel1" runat="server">
                        <table style="width:100%">
                            <tr>
                                <td class="style9">
                                    &nbsp;</td>
                                <td>
                                    <asp:TextBox ID="tbtid" runat="server" Visible="False"></asp:TextBox>
                                    <asp:Image ID="Image2" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Teacher Name</td>
                                <td>
                                    <asp:TextBox ID="tbtname" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="tbtname" ErrorMessage="Plz enter name"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Date of Birth</td>
                                <td>
                                    <asp:DropDownList ID="dddate" runat="server">
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddmonth" runat="server">
                                        <asp:ListItem Value="1">Jan</asp:ListItem>
                                        <asp:ListItem Value="2">Feb</asp:ListItem>
                                        <asp:ListItem Value="3">Mar</asp:ListItem>
                                        <asp:ListItem Value="4">Apr</asp:ListItem>
                                        <asp:ListItem Value="5">May</asp:ListItem>
                                        <asp:ListItem Value="6">Jun</asp:ListItem>
                                        <asp:ListItem Value="7">Jul</asp:ListItem>
                                        <asp:ListItem Value="8">Aug</asp:ListItem>
                                        <asp:ListItem Value="9">Sep</asp:ListItem>
                                        <asp:ListItem Value="10">Oct</asp:ListItem>
                                        <asp:ListItem Value="11">Nov</asp:ListItem>
                                        <asp:ListItem Value="12">Dec</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddyear" runat="server">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Date of Join</td>
                                <td>
                                    <asp:DropDownList ID="ddjdate" runat="server">
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddjmonth" runat="server">
                                        <asp:ListItem Value="1">Jan</asp:ListItem>
                                        <asp:ListItem Value="2">Feb</asp:ListItem>
                                        <asp:ListItem Value="3">Mar</asp:ListItem>
                                        <asp:ListItem Value="4">Apr</asp:ListItem>
                                        <asp:ListItem Value="5">May</asp:ListItem>
                                        <asp:ListItem Value="6">Jun</asp:ListItem>
                                        <asp:ListItem Value="7">Jul</asp:ListItem>
                                        <asp:ListItem Value="8">Aug</asp:ListItem>
                                        <asp:ListItem Value="9">Sep</asp:ListItem>
                                        <asp:ListItem Value="10">Oct</asp:ListItem>
                                        <asp:ListItem Value="11">Nov</asp:ListItem>
                                        <asp:ListItem Value="12">Dec</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddjyear" runat="server">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Gender</td>
                                <td>
                                    <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                                        RepeatDirection="Horizontal">
                                        <asp:ListItem Value="f">Female</asp:ListItem>
                                        <asp:ListItem Value="m">Male</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Photo</td>
                                <td>
                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                                    <asp:TextBox ID="tbphoto" runat="server" Visible="False" 
                                        ></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Permanent Address</td>
                                <td>
                                    <asp:TextBox ID="tbaddress" runat="server" TextMode="MultiLine"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="tbaddress" ErrorMessage="Enter full address"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Phone No.(Resi.)</td>
                                <td>
                                    <asp:TextBox ID="tbreno" runat="server"></asp:TextBox>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                        ControlToValidate="tbreno" ErrorMessage="No Not valid(use:0XXXXXXXXX)" 
                                        ValidationExpression="(0\d{9})"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    Mobile No.</td>
                                <td>
                                    <asp:TextBox ID="tbmobile" runat="server"></asp:TextBox>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                        ControlToValidate="tbmobile" ErrorMessage="No not valid" 
                                        ValidationExpression="(\d{10})"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td class="style10">
                                    User Type</td>
                                <td class="style4">
                                    <asp:DropDownList ID="ddusertype" runat="server">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style10">
                                    Email id</td>
                                <td class="style4">
                                    <asp:TextBox ID="tbmail" runat="server" Width="179px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style10">
                                    Security Question</td>
                                <td class="style4">
                                    <asp:DropDownList ID="ddquestion" runat="server" 
                                        onselectedindexchanged="ddquestion_SelectedIndexChanged">
                                        <asp:ListItem>Who is your best friend?</asp:ListItem>
                                        <asp:ListItem>Which is your birth place?</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style10">
                                    Answer</td>
                                <td class="style4">
                                    <asp:TextBox ID="tbanswer" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style11">
                                    <asp:Label ID="Label1" runat="server" Text="Username"></asp:Label>
                                </td>
                                <td class="style8">
                                    <asp:TextBox ID="tbusername" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    <asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="tbpassword" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style9">
                                    &nbsp;</td>
                                <td>
                                    <asp:Button ID="btnupdate" runat="server" onclick="btnupdate_Click" 
                                        Text="Update" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;</td>
                            </tr>
                        </table>
                        <br />
                    </asp:Panel>
                        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                            Height="50px" onmodechanging="DetailsView1_ModeChanging" Width="320px">
                            <Fields>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Image ID="Image1" runat="server" Height="90px" Width="76px" 
                                            ImageUrl='<%# "~/admin/teacher/"+Eval("photo") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="teacher_name" HeaderText="Name" />
                                <asp:TemplateField HeaderText="Date of Birth">
                                <ItemTemplate><%#Eval("date_of_birth","{0:d}") %></ItemTemplate></asp:TemplateField>
                                <asp:TemplateField HeaderText="Date of Join">
                                <ItemTemplate><%#Eval("date_of_join","{0:d}") %></ItemTemplate></asp:TemplateField>
                                <asp:BoundField DataField="permanent_address" HeaderText="Address" />
                                <asp:BoundField DataField="mobile_pno" HeaderText="Contact No" />
                                <asp:BoundField DataField="teacher_emailid" HeaderText="email id" />
                                <asp:BoundField DataField="username" HeaderText="User Name" />
                                <asp:BoundField DataField="password" HeaderText="Password" />
                                <asp:BoundField DataField="security_question" HeaderText="Security Question" />
                                <asp:BoundField DataField="answer" HeaderText="Answer" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:Button ID="btnedit" runat="server" 
                                            CommandArgument='<%# Eval("teacher_id") %>' CommandName="Edit" 
                                            oncommand="btnedit_Command" Text="Edit" CausesValidation="False" />
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Fields>
                        </asp:DetailsView>
                                    
</asp:Content>

